package com.ccn.crm.util;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

public class StringUtil {
    /**
     *
     */
    public static String getProductPlatform(List<Object> productPlatforms){
        /**
         * 产品平台（多选） field_fgLV9__c  数组(List)
         * 超8 UhK9l6yRk
         * 大黄蜂 LP4jwN7fA
         * customer平台 0GBb9g8e9
         * 蒲公英 pZ4Zm03Qb
         * 用码 fEj5al416
         * 个性化 i79lbxi12
         * 智慧树 7CR71zqvM
         * 产线4.0 25Vl04C72
         * 产线5.0 o928txxD7
         */
        String pp= ",";
        if (productPlatforms.contains("UhK9l6yRk")){
            pp+="1"+",";
        } if(productPlatforms.contains("LP4jwN7fA")){
            pp+=pp+"2"+",";
        } if(productPlatforms.contains("0GBb9g8e9")){
            pp+=pp+"3"+",";
        } if(productPlatforms.contains("pZ4Zm03Qb")){
            pp+=pp+"4"+",";
        } if(productPlatforms.contains("fEj5al416")){
            pp+=pp+"5"+",";
        } if(productPlatforms.contains("i79lbxi12")){
            pp+=pp+"6"+",";
        } if(productPlatforms.contains("7CR71zqvM")){
            pp+=pp+"7"+",";
        } if(productPlatforms.contains("25Vl04C72")){
            pp+=pp+"8"+",";
        } if(productPlatforms.contains("o928txxD7")){
            pp+=pp+"9"+",";
        }
        return  pp.substring(1,pp.length()-1);
    }
    public static List<String> getProductPlatformList(String productPlatforms){
        ArrayList<String> productPlatformList = new ArrayList<>();

        if (productPlatforms.contains("1")){
            productPlatformList.add("UhK9l6yRk");
        } if(productPlatforms.contains("2")){
            productPlatformList.add("LP4jwN7fA");
        } if(productPlatforms.contains("3")){
            productPlatformList.add("0GBb9g8e9");
        } if(productPlatforms.contains("4")){
            productPlatformList.add("pZ4Zm03Qb");
        } if(productPlatforms.contains("5")){
            productPlatformList.add("fEj5al416");
        } if(productPlatforms.contains("6")){
            productPlatformList.add("i79lbxi12");
        } if(productPlatforms.contains("7")){
            productPlatformList.add("7CR71zqvM");
        } if(productPlatforms.contains("8")){
            productPlatformList.add("25Vl04C72");
        } if(productPlatforms.contains("9")){
            productPlatformList.add("o928txxD7");
        }
        return productPlatformList;
    }

    /**
     * 售前工时类型转换
     * @param type
     * @return
     */
    public static String sqType(List<Object> type){
        /**
         * 售前支持类别-营销/防伪类相关开发类（可多选） field_09qHS__c  数组(List)
         * 项目-现场调研option1
         * 项目-仅方案支持T2l91goEo
         * 项目-现场讲标6qaCl55G2
         * 项目-个性化需求评估及初步报价wabvcu3jn
         * 项目-电话会议支持f43U108J7
         * 非项目-学习交流8S8z9kHX9
         * 非项目-会议讨论op1UTq02O
         * 非项目-日常工作5pMcz7CnC
         * 其他other
         */
        String pp= "";
        if (type.contains("option1")){
            pp+="项目-现场调研"+",";
        } if (type.contains("T2l91goEo")){
            pp+="项目-仅方案支持"+",";
        } if (type.contains("6qaCl55G2")){
            pp+="项目-现场讲标"+",";
        } if (type.contains("wabvcu3jn")){
            pp+="项目-个性化需求评估及初步报价"+",";
        }if (type.contains("f43U108J7 ")){
            pp+="项目-电话会议支持"+",";
        }if (type.contains("8S8z9kHX9")){
            pp+="非项目-学习交流"+",";
        }if (type.contains("op1UTq02O")){
            pp+="非项目-会议讨论"+",";
        }if (type.contains("5pMcz7CnC")){
            pp+="非项目-日常工作"+",";
        }if (type.contains("other")){
            pp+="其他"+",";
        }
        if (pp.length()<1){
            return pp;
        }else {
            return  pp.substring(0,pp.length()-1);
        }

    }
}
